<!DOCTYPE html>
<html>
<title>cordova test</title>
<script>
  function onTestBtnClick() {
    alert('123')
    document.addEventListener('deviceready', () => {
     var exec = window.Cordova.exec
     exec((result) => {
        alert(JSON.stringify(result))
      }, () => {
        alert('fail')
      }, 'HelloBridge', 'say', [{name:'test'}])
    })
  }
</script>
<body>
    <button id="buttonA" type="button" onclick="onTestBtnClick()">test</button>
</body>
 <script type="text/javascript" charset="utf-8" src="https://www.baidu.com/js/cordova.harmony.js" ></script>
</html>
